package servlet.admin;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.OrdersService;

/**
 * Servlet implementation class AdminOrdersDeleteServlet
 */
@WebServlet("/admin/orders_delete")
public class orders_delete_Servlet extends HttpServlet {

	private  OrdersService oService = new OrdersService();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		int  id = Integer.parseInt(request.getParameter("id"));
		
		oService.delete(id);
		
		request.getRequestDispatcher("/admin/orders_list").forward(request, response);
		
	}


}
